package com.xiebishe.mylibrary.common

import android.os.Build
import android.widget.EditText
import com.xiebishe.mylibrary.base.MyApplication

private var channel: String? = null
private val device = Build.MODEL
private val release = Build.VERSION.RELEASE
val deviceId = EnvUtils.getDeviceUUID(MyApplication.getInstance()?.applicationContext)
val versionName = EnvUtils.getVersionName()
fun getUA(): String {
    return "$channel;Android;$device;$deviceId;$release;$versionName"
}
fun checkPhone(phone: EditText): Boolean {
    var isPhone = false
    try {
        if (phone.text.toString().isNullOrBlank()) {
            LJToastUtils.showToast("请输入手机号")
            return false
        }
        isPhone = true
    } catch (e: Exception) {
        e.printStackTrace()
    }
    if (!isPhone) {
        LJToastUtils.showToast("请输入正确的手机号")
    }
    return isPhone
}